<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Obrada po brojevima</title>

<script type="text/javascript" src="http://localhost:8080/eva/dojo/dojo.js.uncompressed.js"></script>
<script type="text/javascript" src="http://localhost:8080/eva/token/token.js"></script>
<script type="text/javascript" src="http://localhost:8080/eva/token/connection.js"></script>
<script type="text/javascript">
function init(){
	token = new tokenClient.Object('http://localhost:8080/eva/');
	initializeBayeuxConnection('http://localhost:8080/eva/cometd');
	token.doSubscribe();
}
</script>
</head>
<body onload="init()">
<div class="frame" style="width:350px; height:450px; border-style:solid; border-width:1px; display:block">
	<table style="margin-left: auto; margin-right: auto;">
	<tbody style="text-align:center">
		<tr>
			<td colspan="2">
				<div class="instance" id="instance">
					<span>Poslovnica: </span><a id="poslovnica" href="javascript:token.choosePoslovnica();">FER-Miro</a><br>
					<span>1 šalter proziva brojeve</span><br>
					<b><span id="zaslon" class="zaslon" style="display: block; width:100px; margin:0 auto;
						background-color:black; color:red; border:3px solid black;
						font-family:'Lucida Console', Monaco, monospace
						">0</span></b>
					<hr class = "separator" style = "color: blue; width:95%;" />
				</div>
			</td>
		</tr>
		<tr>
			<td style="padding-right:10px;">
				<span>Želite uzeti broj za čekanje?</span><br>
				<input type="button" value="Uzmi!" id="uzmi" onclick="token.takeNmbr()" title="Kliknite ako hocete." />
			</td>
			<td style="padding-left:10px;">
				<div id = "pickWaitingTime">
					<span>Koliko dugo želite čekati?</span><br>
					<select selected="Zauvijek" id = 'selectedWaiting' onclick="token.selectedWaiting()">
						<option>Zauvijek</option>
						<option>1 min</option>
						<option>5 min</option>
						<option>10 min</option>
						<option>15 min</option>
					</select>
				</div>
				<div id = "itIsYourTurn" style = "display:none">
					<span>Došli ste na red!</span>
				</div>
			</td>
		</tr>
		<tr>
			<td style="padding-right:10px;">
				<span>Broj koji ste primili:</span><br>
				<input type="text" id = "myNmbr" disabled="yes" value="-" style="width:75px; text-align:center" />
			</td>
			<td style="padding-left:10px;">
				<div id = "enough-LeaveNow">
					<input type="button" id="dosta" value="Dosta!" onclick="token.leave();" />
				</div>
				<div id = "pickLeavingAction" style = "display:none">
					<span>Akcija odustajanja:</span>
					<input type="button" value="?" id="leavingAction" />
				</div>
			</td>
		</tr>
		<tr>
			<td colspan="2" style="padding-top:10px;">
				<span>Prozivanje vašeg broja</span>
				<hr class = "separator" style = "color: blue; width:95%;" />
			</td>
		</tr>
		<tr>
			<td style="padding-right:10px;">
				<div id = "pickComingAction" >
					<span>Odaziv na prozivanje:</span><br>
					<input type="button" id="odaziv" value="Nije izabran" style="width:150px" onclick="token.hello(1)" />
				</div>
				<div id = "countDown" style = "display:none">
					<span>Vrijeme za odaziv: </span>
					<span id="countDownValue">_</span>
					<span> sec</span><br>
					<input type="button" id="zdravo" value="Odazovi se!" onclick="token.hello(0)" />
				</div>
			</td>
			<td style="padding-left:10px;">
				<span>Jeste li završili?</span><br>
				<input type="button" id="dovidjenja" value="Doviđenja!" onclick="token.bye()" />
			</td>
		</tr>
	</tbody>
	</table>
	<hr />
	<div id="message">
	</div>	
</div>
</body>
</html>